-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create skeleton and navigation for FIE ampdocs #22737
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM.
return ( | ||
value.nodeType == /* DOCUMENT_FRAGMENT */ 11 && | ||
Object.prototype.toString.call(value) === '[object ShadowRoot]' | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this code path? I think we can just check tagName
inline and call it a day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. It's too difficult to assume that this API will only be called in the polyfill case. It's a reasonable check for any node. Unfortunately, shadow roots have DOCUMENT_FRAGMENT type and thus difficult to determine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I mean we could remove this function and just check tagName anywhere we care. Or rename to isPolyfillShadowRoot
. Save a few bytes for an unused code path. :)
6085a5e
to
3e492ff
Compare
* Create skeleton and navigation for FIE ampdocs * review fixes * lints * fixes * test fixes * fix tests
Partial for #22734.